package gui.reservation;

import gui.FenetrePrincipale;

import java.awt.event.ActionListener;

import main.GestionnaireReservation;
import model.Reservation;
import javax.swing.JLabel;
import javax.swing.JButton;

import Controleur.ControleurReservation;
import javax.swing.JPanel;

public class ConfirmationFenetre extends FenetrePrincipale {
	private int numeroConfirmation;

	public ConfirmationFenetre(Reservation reservation,ActionListener ctrl){		
		super();
		
		numeroConfirmation = reservation.getNumConfirmation();
		
		afficher(ctrl);
	}
	
	@Override
	public void afficher(ActionListener ctrl) {
		setTitle("Confirmation");
		setBounds(0,0,493,188);
		init();
		getContentPane().setLayout(null);
		
		JPanel panelConfirmer = new JPanel();
		panelConfirmer.setBounds(0, 0, 475, 139);
		getContentPane().add(panelConfirmer);
		panelConfirmer.setLayout(null);
		
		JLabel lblIdClient = new JLabel("ID Client:");
		lblIdClient.setBounds(12, 40, 53, 16);
		panelConfirmer.add(lblIdClient);
		
		JLabel lblIdclientfull = new JLabel(GestionnaireReservation.getClient().getIDClient());
		lblIdclientfull.setBounds(164, 40, 299, 16);
		panelConfirmer.add(lblIdclientfull);
		
		JButton btnConfirmer = new JButton("Confirmer");
		btnConfirmer.setBounds(182, 101, 101, 25);
		panelConfirmer.add(btnConfirmer);
		btnConfirmer.addActionListener(ctrl);
		btnConfirmer.setActionCommand(String.valueOf(ControleurReservation.FENETRE_CONFIRMATION_TERMINER));
		
		JLabel lblNumeroConfirmationTxt = new JLabel("Numero de confirmation :");
		lblNumeroConfirmationTxt.setBounds(12, 13, 147, 16);
		panelConfirmer.add(lblNumeroConfirmationTxt);
		
		JLabel lblNumeroConfirmationNum = new JLabel("" + numeroConfirmation);
		lblNumeroConfirmationNum.setBounds(164, 13, 299, 16);
		panelConfirmer.add(lblNumeroConfirmationNum);
		
		setVisible(true);
	}
}
